<?php

/**
 * DetalleHistoriaClinica form base class.
 *
 * @package    form
 * @subpackage detalle_historia_clinica
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseDetalleHistoriaClinicaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'historia_clinica_id' => new sfWidgetFormDoctrineChoice(array('model' => 'HistoriaClinica', 'add_empty' => false)),
      'doctor_id'           => new sfWidgetFormDoctrineChoice(array('model' => 'Doctor', 'add_empty' => false)),
      'codigo'              => new sfWidgetFormInput(),
      'observaciones'       => new sfWidgetFormTextarea(),
      'estado'              => new sfWidgetFormInput(),
      'slug'                => new sfWidgetFormInput(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorDoctrineChoice(array('model' => 'DetalleHistoriaClinica', 'column' => 'id', 'required' => false)),
      'historia_clinica_id' => new sfValidatorDoctrineChoice(array('model' => 'HistoriaClinica')),
      'doctor_id'           => new sfValidatorDoctrineChoice(array('model' => 'Doctor')),
      'codigo'              => new sfValidatorString(array('max_length' => 10)),
      'observaciones'       => new sfValidatorString(array('max_length' => 2147483647, 'required' => false)),
      'estado'              => new sfValidatorString(array('max_length' => 1)),
      'slug'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'DetalleHistoriaClinica', 'column' => array('slug')))
    );

    $this->widgetSchema->setNameFormat('detalle_historia_clinica[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'DetalleHistoriaClinica';
  }

}
